package com.lyf.language.practice;

import java.lang.reflect.Field;
import java.util.Arrays;

/**
 * @author liyunfei
 */
public class ReflectionTests {
    private static class Class1{
        public static final String NACOS_CORE_CONFIG_PLUGIN_POINTCUT_NAMES = "import,publish,remove";
    }
    private static class Class2{}
    static {
        Class[] classes = ReflectionTests.class.getDeclaredClasses();
        for (Class clazz:classes){
            System.out.println(clazz.getName()+":"+clazz.getSimpleName());
            try {
                Field field = clazz.getField("NACOS_CORE_CONFIG_PLUGIN_POINTCUT_NAMES");
//                field.setAccessible(true);
//                System.out.println(field.getName());
                System.out.println(field.get(null));
            } catch (NoSuchFieldException | IllegalAccessException e) {
                e.printStackTrace();
            }
        }
    }
    public static void main(String[] args) {
        System.out.println(Arrays.toString("publish".split("\\,")));
    }
}
